[Notebooks](../) - [Access to Geospatial data](../Access to Geospatial data)

OSSIM Command Line Applications

The following command line applications are distributed with OSSIM.

Core Programs

Utilities to Create Support Files

The following tools are used to create OSSIM support files:


OSSIM-Applications

  • ossim-band-merge Merge multiple image files into a single n-band dataset.
  • ossim-chipper Render elevation data (e.g. shaded relief).
  • ossim-icp Convert an image from one format to another.
  • ossim-igen Execute image chains specified in a spec file.
  • ossim-orthoigen Tool to orthorectify, mosaic, and convert raster data between different formats. It provides a number of operations including subsetting, resampling, histogram matching, and reprojection of data.
  • ossim-rpf Various utilities for managing RPF data.
  • Import IPython utility to display images

In [ ]:
from IPython.core.display import Image
  • Set the PATH to the natural earth dataset used in this notebook

In [ ]:
DATADIR='/home/main/notebooks/data/landsat/'

In [ ]:
# we'll use the north_carolina image dataset
!ls {DATADIR} | grep tif

ossim-info

top


In [ ]:
!ossim-info

Utility functions

radians from degrees

ossim-info --deg2rad <degrees>


In [ ]:
!ossim-info --deg2rad 20.54

top

degrees from radians

ossim-info --rad2deg <radians>


In [ ]:
!ossim-info --rad2deg 0.35849

top

meters from feet

  • 0.3048 meters per foot

    ossim-info --ft2mtrs <feet>


In [ ]:
!ossim-info --ft2mtrs 1
  • 0.3048006096 meters per foot

    ossim-info --ft2mtrs-us-survey <feet>


In [ ]:
!ossim-info --ft2mtrs-us-survey 1

top

meters to feet

  • 0.3048 meters per foot

    ossim-info --mtrs2ft <meters>


In [ ]:
!ossim-info --mtrs2ft 1
  • 0.3048006096 meters per foot

    ossim-info --mtrs2ft-us-survey <meters>


In [ ]:
!ossim-info --mtrs2ft-us-survey  1

top

height

return the MSL and ellipoid height given a latitude longitude position

ossim-info --height <latitude-in-degrees> <longitude-in-degrees>


In [ ]:
# note we pass the path to the ossim_preference file to tell where the geoid file is
!ossim-info --height 47.54 157.40 -P /usr/local/share/ossim/ossim_preference

top

Meters per degrees

Gives meters per degree and meters per minute for a given latitude.
ossim-info --mtrsPerDeg <latitude>


In [ ]:
!ossim-info --mtrsPerDeg 65.45

top

Datums

Prints datum list. ossim-info --datums


In [ ]:
!ossim-info --datums

Projections

Prints projections list ossim-info --projections


In [ ]:
!ossim-info --projections

top

Explore raster data

ground center

```ossim-info --cg filename```

In [ ]:
!ossim-info --cg {DATADIR}/p011r031_7t19990918_z19_nn10.tif -P /usr/local/share/ossim/ossim_preference

top

image center

```ossim-info  --ci filename```         

In [ ]:
!ossim-info  --ci {DATADIR}/p011r031_7t19990918_z19_nn10.tif -P /usr/local/share/ossim/ossim_preference

top

ground and image center

```ossim-info -c filename```

In [ ]:
!ossim-info  -c {DATADIR}/p011r031_7t19990918_z19_nn10.tif -P /usr/local/share/ossim/ossim_preference

top

general image information

```ossim-info -i filename```

In [ ]:
!ossim-info  -i {DATADIR}/p011r031_7t19990918_z19_nn10.tif -P /usr/local/share/ossim/ossim_preference

top

meta data image information

ossim-info -m filename

In [ ]:
!ossim-info  -m {DATADIR}/p011r031_7t19990918_z19_nn10.tif -P /usr/local/share/ossim/ossim_preference

top

image projection information

ossim-info -p filename

In [ ]:
!ossim-info  -p {DATADIR}/p011r031_7t19990918_z19_nn10.tif -P /usr/local/share/ossim/ossim_preference

top

image rectangle

ossim-info -r filename

In [ ]:
!ossim-info  -r {DATADIR}/p011r031_7t19990918_z19_nn10.tif -P /usr/local/share/ossim/ossim_preference

top

ossim-img2rr


In [ ]:
!ossim-img2rr {DATADIR}/p011r031_7t19990918_z19_nn10.tif -P /usr/local/share/ossim/ossim_preference

In [ ]:
!ossim-img2rr {DATADIR}/p011r031_7t19990918_z19_nn20.tif -P /usr/local/share/ossim/ossim_preference

In [ ]:
!ossim-img2rr {DATADIR}/p011r031_7t19990918_z19_nn30.tif -P /usr/local/share/ossim/ossim_preference

ossim-cmm


In [ ]:
!ossim-cmm {DATADIR}/p011r031_7t19990918_z19_nn10.tif -P /usr/local/share/ossim/ossim_preference

In [ ]:
!ossim-cmm {DATADIR}/p011r031_7t19990918_z19_nn20.tif -P /usr/local/share/ossim/ossim_preference

In [ ]:
!ossim-cmm {DATADIR}/p011r031_7t19990918_z19_nn30.tif -P /usr/local/share/ossim/ossim_preference

In [ ]:
!cat /home/main/notebooks/data/landsat/p011r031_7t19990918_z19_nn10.omd

ossim-img2md

Usage: ossim-img2md [options] <metadata_writer> <input_file> <output_file>


  • Valid metadata writer types:
    • envi_header
    • ers_header
    • ossim_fgdc
    • ossim_geometry
    • ossim_readme
    • tiff_world_file
    • jpeg_world_file

In [ ]:
!ossim-img2md -P /usr/local/share/ossim/ossim_preference tiff_world_file {DATADIR}/p011r031_7t19990918_z19_nn10.tif {DATADIR}/p011r031_7t19990918_z19_nn10.tfw

In [ ]:
!cat /home/main/notebooks/data/landsat//p011r031_7t19990918_z19_nn10.tfw

ossim-band-merge

ossim-band-merge [-h][-o][-w tile_width] <output_type> <input_file1> <input_file2> ... <output_file>

Example, crete an RGB image from the single-band grayscale r,g,b images (Landsat 7)


In [ ]:
!ossim-band-merge jpeg -P /usr/local/share/ossim/ossim_preference \
                 {DATADIR}/p011r031_7t19990918_z19_nn30.tif \
                 {DATADIR}/p011r031_7t19990918_z19_nn20.tif \
                 {DATADIR}/p011r031_7t19990918_z19_nn10.tif \
                 rgb.jpeg

In [ ]:
!ossim-cmm rgb.jpeg -P /usr/local/share/ossim/ossim_preference

In [ ]:
!cat rgb.omd

In [ ]:
Image("rgb.jpeg")

top

ossim-create-histo


In [ ]:
!ossim-create-histo {DATADIR}/p011r031_7t19990918_z19_nn30.tif \
{DATADIR}/p011r031_7t19990918_z19_nn20.tif \
{DATADIR}/p011r031_7t19990918_z19_nn10.tif

In [ ]:
!ossim-orthoigen --hist-auto-minmax {DATADIR}/p011r031_7t19990918_z19_nn30.tif {DATADIR}/p011r031_7t19990918_z19_nn30_histmm.tif -P /usr/local/share/ossim/ossim_preference
!ossim-orthoigen --hist-auto-minmax {DATADIR}/p011r031_7t19990918_z19_nn20.tif {DATADIR}/p011r031_7t19990918_z19_nn20_histmm.tif -P /usr/local/share/ossim/ossim_preference
!ossim-orthoigen --hist-auto-minmax {DATADIR}/p011r031_7t19990918_z19_nn10.tif {DATADIR}/p011r031_7t19990918_z19_nn10_histmm.tif -P /usr/local/share/ossim/ossim_preference

In [ ]:
!ossim-band-merge jpeg -P /usr/local/share/ossim/ossim_preference \
                 {DATADIR}/p011r031_7t19990918_z19_nn30_histmm.tif \
                 {DATADIR}/p011r031_7t19990918_z19_nn20_histmm.tif \
                 {DATADIR}/p011r031_7t19990918_z19_nn10_histmm.tif \
                 rgb_histmm.jpeg

In [ ]:
Image('rgb_histmm.jpeg')

ossim-chipper


In [ ]:
!ossim-chipper --color 255 255 255 \
              --azimuth 270 \
              --elevation 45 \
              --exaggeration 2.0 \
              --op hillshade \
              --color-table {DATADIR}/ossim-dem-color-table-template.kwl \
              --input-dem {DATADIR}/SRTM_fB03_p011r031.tif \
              hillshade.jpg -P /usr/local/share/ossim/ossim_preference

In [ ]:
!ossim-info {DATADIR}/SRTM_fB03_p011r031.tif -P /usr/local/share/ossim/ossim_preference

In [ ]:
!gdalinfo {DATADIR}/SRTM_fB03_p011r031.tif

In [ ]:
Image('hillshade.jpg')

top

ossim-icp

ossim-icp [options] <output_type> <input_file> <output_file>


In [ ]:
# A complete list of ossim writers (driver) is given by:
!ossim-info --writers -P /usr/local/share/ossim/ossim_preference

In [ ]:
#convert a geotiff to a geopdf
!ossim-icp ossim_pdf rgb_histmm.jpeg rgb_histmm.pdf

In [ ]:
#view the results in a pdf viewer
#nohup evince lsat7_2002_30.pdf &

top

ossim-igen

Execute image chains specified in a spec file.

In the folowing example the spec file rgb.spec has been generated using imagelinker, from an example session: /home/user/ossim/ossim-rgb.prj


In [ ]:
#ossim-igen /home/user/ossim/rgb.spec

In [ ]:
#display < /home/user/rgb.jpg

top

ossim-orthoigen

todo

ossim-rpf

todo

top